Mobile phones and digital cameras typically have a rolling shutter which scans over the scene which is capture in the image. During scanning the camera may move, objects in the image may move or the whole scene/target may move. If more than one photo is captured of the same target in order to improve the image quality by combining the images, the movement between the scene and the camera may be different in different photos which decreases or eliminates the possibility of improvement. Additionally, the movement may not necessarily be linear which further complicates the situation. For example, if the upper and lower parts of two images match together but at the same time the middle part has a shift even only by one pixel, the images cannot be combined without a substantial reduction in quality. Thus, there is a need for improvement in image processing.